import reactPlugin from 'think-react-app';
reactPlugin.init();

const moduleScope = {
	init() {
		think.middleware('rewrite', http => {
			if (/^(\w+\/)static/.test(http.pathname)) {
				http.pathname = http.pathname.slice(RegExp.$1.length);
				console.log(http.pathname)
			}
		});
		think.hook('resource', ['prepend', 'rewrite']);
	}
}

moduleScope.init();